<?php
/**
 * Created by PhpStorm.
 * User: jacob
 * Date: 18-8-10
 * Time: 下午4:55
 */
namespace DB;

use Tiny\Logger;

class MariaDB{
  private $manager = null;

  public function getManager(){
    if ($this->manager == null){
      try{
        $this->manager = new \PDO('mysql:host='.\Config\MariaDB::MariaDB_host.';dbname='.
          \Config\MariaDB::MariaDB_dbname,\Config\MariaDB::MariaDB_username,
          \Config\MariaDB::MariaDB_password);
      }catch (\Exception $exception){
        Logger::getInstance()->debug("MariaDB连接失败".$exception->getMessage());
      }
    }
    return $this->manager;
  }
}